<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" class="inp1" />
    <input type="text" class="inp2" />
    <button class="btn">运算</button>
    <input type="text" class="inp3" />
    <script>
      let inp1 = document.querySelector(".inp1");
      let inp2 = document.querySelector(".inp2");
      let btn = document.querySelector(".btn");
      let inp3 = document.querySelector(".inp3");
      btn.onclick = function () {
        for (let i = inp1.value; i <= inp2.value; i++) {
          sum = 0;
          temp = i;
          while (temp > 0) {
            let digit = temp % 10;
            sum += digit ** 3;
            temp = Math.floor(temp / 10);
          }
          if (sum === i) {
            inp3.value += "  " + sum;
          }
        }
      };
    </script>
  </body>
</html>
